package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.EachTypeImages;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/EachTypeImagesMapper.class */
public interface EachTypeImagesMapper {
    @Select({"select * from each_type_images where type_id = #{typeId} and type = #{type} order by id desc"})
    @Results(id = "map", value = {@Result(property = "typeId", column = "type_id"), @Result(property = "createTime", column = "create_time")})
    List<EachTypeImages> findbyTypeIdAndType(@Param("typeId") Integer num, @Param("type") String str);

    @Select({"select * from each_type_images "})
    List<EachTypeImages> findAll();

    @Select({"select * from each_type_images where id = #{id}"})
    @ResultMap({"map"})
    EachTypeImages findById(@Param("id") Integer num);

    @Insert({"insert into each_type_images (type_id,connect,create_time,type) values (#{typeId},#{connect},#{createTime},#{type})"})
    Integer add(@Param("typeId") Integer num, @Param("connect") String str, @Param("createTime") String str2, @Param("type") String str3);

    @Update({"<script>update each_type_images <set><if test='typeId != null '>type_id=#{typeId},</if><if test='connect != null and connect.length &gt; 0'>connect=#{connect},</if><if test='createTime != null and createTime.length &gt; 0'>createTime=#{createTime},</if><if test='type != null and type.length &gt; 0'>type=#{type},</if></set>where id=#{id}</script>"})
    Integer update(EachTypeImages eachTypeImages);

    @Delete({"delete from each_type_images where id=#{id}"})
    Integer delete(Integer num);

    @Delete({"delete from each_type_images where  type_id = #{typeId} and type = #{type}"})
    Integer deleteByType(@Param("typeId") Integer num, @Param("type") String str);
}